-
Notifications
You must be signed in to change notification settings - Fork 5.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
planner: introduce some new hints for MPP plans #38516
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
shuffleJoins := p.tryToGetMppHashJoin(prop, false) | ||
if (p.preferJoinType&preferShuffleJoin) > 0 && len(shuffleJoins) > 0 { // has shuffle_join hints | ||
return shuffleJoins, true, nil | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we have both BCJoin hint and shuffle join hint, it seems we will chose the shuffle join. Is it expected?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The behavior of using multiple conflict hints together seems undefined. Let's notify our users on docs and any expectation wouldn't be guaranteed here.
if la.aggHints.preferAggType&preferMPP1PhaseAgg > 0 { | ||
preferModes = append(preferModes, Mpp1Phase) | ||
} else if la.aggHints.preferAggType&preferMPP2PhaseAgg > 0 { | ||
preferModes = append(preferModes, Mpp2Phase) | ||
} else if la.aggHints.preferAggType&preferMPPTiDBAgg > 0 { | ||
preferModes = append(preferModes, MppTiDB) | ||
} else if la.aggHints.preferAggType&preferMPPScalarAgg > 0 { | ||
preferModes = append(preferModes, MppScalar) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there are more one mpp aggregation hints. We can only use one?
Change this part to
if .. {}
if .. {}
if .. {}
if .. {}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good Catch. But on second thought, it seems that the behavior of using multiple agg-hints together is undefined, so I finally update this part to preferMode
instead of preferModes
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rest LGTM
/run-build |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: bd8af96
|
return bcastJoins, true, nil | ||
} | ||
joins = append(joins, bcastJoins...) | ||
joins = append(joins, shuffleJoins...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there is no hint and p.shouldUseMPPBCJ
is false, the old code only adds shuffleJoins
but the new code adds both bcastJoins
and shuffleJoins
. Is that an expected change?
/run-build |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: e7268f9
|
/merge |
This pull request has been accepted and is ready to merge. Commit hash: cc9a3c3
|
/rebuild |
/run-build |
TiDB MergeCI notify🔴 Bad News! [2] CI still failing after this pr merged.
|
What problem does this PR solve?
Issue Number: close #xxx
Problem Summary: planner: introduce some new hints for MPP plans
What is changed and how it works?
Introduce some new hints for MPP plans: mpp_1phase_agg(), mpp_2phase_agg(), mpp_tidb_agg(), mpp_scalar_agg(), shuffle_join().
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.